home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-avt-rtp-04.txt < prev    next >
Text File  |  1993-10-21  |  107KB  |  2,236 lines

  1. Internet Engineering Task Force                     Audio-Video Transport WG
  2. INTERNET-DRAFT                                      H. Schulzrinne/S. Casner
  3. draft-ietf-avt-rtp-04.txt                                           AT&T/ISI
  4.                                                             October 20, 1993
  5.                                                           Expires:  12/31/93
  6.  
  7.             RTP: A Transport Protocol for Real-Time Applications
  8.  
  9.  
  10. Status of this Memo
  11.  
  12.  
  13. This document is an Internet Draft.  Internet Drafts are working documents
  14. of the Internet Engineering Task Force (IETF), its Areas, and its Working
  15. Groups.   Note that other groups may also distribute working documents as
  16. Internet Drafts.
  17.  
  18. Internet Drafts are draft documents valid for a maximum of six months.
  19. Internet Drafts may be updated, replaced, or obsoleted by other documents
  20. at any time.   It is not appropriate to use Internet Drafts as reference
  21. material or to cite them other than as a ``working draft'' or ``work in
  22. progress.''
  23.  
  24. Please check the I-D abstract listing contained in each Internet Draft
  25. directory to learn the current status of this or any other Internet Draft.
  26.  
  27. Distribution of this document is unlimited.
  28.  
  29.  
  30.                                   Abstract
  31.  
  32.      This memorandum describes the real-time transport protocol, RTP.
  33.     RTP provides end-to-end network transport functions suitable for
  34.     applications transmitting real-time data, such as audio, video
  35.     or simulation data over multicast or unicast network services.
  36.     RTP does not address resource reservation and does not guarantee
  37.     quality-of-service for real-time services.  The data transport is
  38.     augmented by a control protocol (RTCP) designed to provide minimal
  39.     control and identification functionality particularly in multicast
  40.     networks.   Within multicast associations, sites can also direct
  41.     control messages to individual sites.  RTP and RTCP are designed to
  42.     be independent of the underlying transport and network layers.  The
  43.     protocol supports the use of RTP-level translators and bridges.
  44.  
  45.  
  46. This specification is a product of the Audio/Video Transport working group
  47. within the Internet Engineering Task Force.   Comments are solicited and
  48. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  49.  
  50. should be addressed to the working group's mailing list at rem-conf@es.net
  51. and/or the authors.
  52.  
  53.  
  54. Contents
  55.  
  56.  
  57. 1 Introduction                                                            3
  58.  
  59. 2 RTP Use Scenarios                                                       5
  60.  
  61.   2.1 Simple Multicast Audio Conference. . . . . . . . . . . . . . . . . 5
  62.  
  63.   2.2 Bridges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
  64.  
  65.   2.3 Translators. . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
  66.  
  67.   2.4 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
  68.  
  69. 3 Definitions                                                             8
  70.  
  71. 4 Byte Order, Alignment, and Reserved Values                             10
  72.  
  73. 5 RTP Data Transfer Protocol                                             11
  74.  
  75.   5.1 RTP Fixed Header Fields. . . . . . . . . . . . . . . . . . . . . . 11
  76.  
  77.   5.2 The RTP Options. . . . . . . . . . . . . . . . . . . . . . . . . . 13
  78.  
  79.     5.2.1CSRC: Content source identifiers. . . . . . . . . . . . . . . . 13
  80.  
  81.     5.2.2SSRC: Synchronization source identifier . . . . . . . . . . . . 14
  82.  
  83.     5.2.3BOS: Beginning of synchronization unit. . . . . . . . . . . . . 15
  84.  
  85.   5.3 APP: Application-specific option . . . . . . . . . . . . . . . . . 15
  86.  
  87.   5.4 Reverse-Path Option. . . . . . . . . . . . . . . . . . . . . . . . 16
  88.  
  89.     5.4.1SDST: Synchronization destination identifier. . . . . . . . . . 17
  90.  
  91.   5.5 Security Options . . . . . . . . . . . . . . . . . . . . . . . . . 18
  92.  
  93.     5.5.1ENC: Encryption . . . . . . . . . . . . . . . . . . . . . . . . 21
  94.  
  95.     5.5.2MIC: Messsage integrity check . . . . . . . . . . . . . . . . . 22
  96.  
  97.     5.5.3MICA: Message integrity check, asymmetric encryption. . . . . . 22
  98.  
  99.  
  100. H. Schulzrinne/S. Casner              Expires 12/31/93              [Page 2]
  101. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  102.  
  103.     5.5.4MICK: Message integrity check, keyed. . . . . . . . . . . . . . 23
  104.  
  105.     5.5.5MICS: Message integrity check, symmetric-key encrypted. . . . . 24
  106.  
  107. 6 RTP Control Protocol --- RTCP                                          25
  108.  
  109.   6.1 FMT: Format description. . . . . . . . . . . . . . . . . . . . . . 25
  110.  
  111.   6.2 SDES: Source descriptor. . . . . . . . . . . . . . . . . . . . . . 26
  112.  
  113.   6.3 BYE: Goodbye . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
  114.  
  115.   6.4 QOS: Quality of service measurement. . . . . . . . . . . . . . . . 30
  116.  
  117. 7 Security Considerations                                                32
  118.  
  119. 8 RTP over Network and Transport Protocols                               33
  120.  
  121.   8.1 Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  122.  
  123.   8.2 ST-II. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  124.  
  125. 9 RTP Profiles                                                           34
  126.  
  127. A Implementation Notes                                                   35
  128.  
  129.   A.1 Timestamp Recovery . . . . . . . . . . . . . . . . . . . . . . . . 36
  130.  
  131.   A.2 Detecting the Beginning of a Synchronization Unit. . . . . . . . . 37
  132.  
  133.   A.3 Demultiplexing and Locating the Synchronization Source . . . . . . 38
  134.  
  135.   A.4 Parsing RTP Options. . . . . . . . . . . . . . . . . . . . . . . . 38
  136.  
  137.   A.5 Determining the Expected Number of RTP Packets . . . . . . . . . . 39
  138.  
  139. B Addresses of Authors                                                   40
  140.  
  141.  
  142. 1 Introduction
  143.  
  144.  
  145. This  memorandum  specifies  the  real-time  transport  protocol  (RTP),
  146. which  provides  end-to-end  delivery  services  for  data  with  real-time
  147. characteristics, for example, interactive audio and video.   RTP itself
  148. does not provide any mechanism to ensure timely delivery or provide other
  149. quality-of-service guarantees, but relies on lower-layer services to do so.
  150.  
  151.  
  152. H. Schulzrinne/S. Casner              Expires 12/31/93              [Page 3]
  153. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  154.  
  155. It does not guarantee delivery or prevent out-of-order delivery, nor does
  156. it assume that the underlying network is reliable and delivers packets in
  157. sequence.   The sequence numbers included in RTP allow the end system to
  158. reconstruct the sender's packet sequence, but sequence numbers might also
  159. be used to determine the proper location of a packet, for example in video
  160. decoding, without necessarily decoding packets in sequence.  RTP is designed
  161. to run on top of a variety of network and transport protocols, for example,
  162. IP, ST-II or UDP.(1) RTP transfers data in a single direction, possibly to
  163. multiple destinations if supported by the underlying network.  A mechanism
  164. for sending control data in the opposite direction, reversing the path
  165. traversed by regular data, is provided.
  166.  
  167. While RTP is primarily designed to satisfy the needs of multi-participant
  168. multimedia conferences, it is not limited to that particular application.
  169. Storage of continuous data,  interactive distributed simulation,  active
  170. badge,  and  control  and  measurement  applications  may  also  find  RTP
  171. applicable.   Profiles are used to instantiate certain header fields and
  172. options for particular sets of applications (see Section 9).   A profile
  173. for audio and video data may be found in the companion Internet draft
  174. draft-ietf-avt-profile.
  175.  
  176. This document defines a packet format shared by two protocols:
  177.  
  178.  
  179.   o the real-time transport protocol (RTP), for exchanging data that has
  180.     real-time properties.    The RTP header consists of a fixed-length
  181.     portion plus optional control fields;
  182.  
  183.   o the RTP control protocol (RTCP), for conveying information about the
  184.     participants in an on-going session.   RTCP consists of additional
  185.     header options that may be ignored without affecting the ability
  186.     to receive data correctly.   RTCP is used for "loosely controlled"
  187.     sessions, i.e., where there is no explicit membership control and
  188.     set-up.    Its functionality may be subsumed by a session control
  189.     protocol, which is beyond the scope of this document.
  190.  
  191.  
  192. A discussion of real-time services and algorithms for their implementation
  193. and background on some of the RTP design decisions can be found in the
  194. current version of the companion Internet draft draft-ietf-avt-issues.
  195.  
  196. The current Internet does not support the widespread use of real-time
  197. services.     High-bandwidth  services  using  RTP,  such  as  video,  can
  198. potentially seriously degrade other network services.  Thus, implementors
  199. should take appropriate precautions to limit accidental bandwidth usage.
  200. Application  documentation  should  clearly  outline  the  limitations  and
  201. possible operational impact of high-bandwidth real-time services on the
  202. ------------------------------
  203.  1. For most applications, RTP offers insufficient demultiplexing to run
  204. directly on IP.
  205.  
  206.  
  207. H. Schulzrinne/S. Casner              Expires 12/31/93              [Page 4]
  208. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  209.  
  210. Internet and other network services.
  211.  
  212.  
  213. 2 RTP Use Scenarios
  214.  
  215.  
  216. The following sections describe some aspects of the use of RTP. The examples
  217. were chosen to illustrate the basic operation of applications using RTP,
  218. not to limit what RTP may be used for.    In these examples, RTP is
  219. carried on top of IP and UDP, and follows the conventions established by
  220. the profile for audio and video specified in the companion Internet draft
  221. draft-ietf-avt-profile.
  222.  
  223.  
  224. 2.1 Simple Multicast Audio Conference
  225.  
  226.  
  227. A working group of the IETF meets to discuss the latest protocol draft,
  228. using the IP multicast services of the Internet for voice communications.
  229. Through some allocation mechanism,  the working group chair obtains a
  230. multicast group address; all participants use the destination UDP port
  231. specified by the profile.  The multicast address and port are distributed,
  232. say, by electronic mail, to all intended participants.  The mechanisms for
  233. discovering available multicast addresses and distributing the information
  234. to participants are beyond the scope of RTP.
  235.  
  236. The audio conferencing application used by each conference participant sends
  237. audio data in small chunks of, say, 20 ms duration.  Each chunk of audio
  238. data is preceded by an RTP header; RTP header and data are in turn contained
  239. in a UDP packet.  The Internet, like other packet networks, occasionally
  240. loses and reorders packets and delays them by variable amounts of time.  To
  241. cope with these impairments, the RTP header contains timing information and
  242. a sequence number that allow the receivers to reconstruct the timing seen
  243. by the source, so that, in our case, a chunk of audio is delivered to the
  244. speaker every 20 ms.  The sequence number can also be used by the receiver
  245. to estimate how many packets are being lost.  Each RTP packet also indicates
  246. what type of audio encoding (such as PCM, ADPCM or GSM) is being used,
  247. so that senders can change the encoding during a conference, for example,
  248. to accommodate a new participant that is connected through a low-bandwidth
  249. link.
  250.  
  251. Since members of the working group join and leave during the conference, it
  252. is useful to know who is participating at any moment.  For that purpose,
  253. each instance of the audio application in the conference periodically
  254. multicasts the name, email address and other information of its user.  Such
  255. control information is carried as RTCP SDES options within RTP messages,
  256. with or without audio data (see Section 6.2).   These periodic messages
  257. also provide some indication as to whether the network connection is still
  258. functioning.   A site sends the RTCP BYE (Section 6.3) option when it
  259. leaves a conference.  The RTCP QOS (Section 6.4) option indicates how well
  260.  
  261.  
  262. H. Schulzrinne/S. Casner              Expires 12/31/93              [Page 5]
  263. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  264.  
  265. the current speaker is being received and may be used to control adaptive
  266. encodings.
  267.  
  268.  
  269. 2.2 Bridges
  270.  
  271.  
  272. So far, we have assumed that all sites want to receive audio data in the
  273. same format.   However, this may not always be appropriate.   Consider
  274. the case where participants in one area are connected through a low-speed
  275. link to the majority of the conference participants, who enjoy high-speed
  276. network access.   Instead of forcing everyone to use a lower-bandwidth,
  277. reduced-quality audio encoding, a bridge is placed near the low-bandwidth
  278. area.  This bridge resynchronizes incoming audio packets to reconstruct the
  279. constant 20 ms spacing generated by the sender, mixes these reconstructed
  280. audio streams, translates the audio encoding to a lower-bandwidth one and
  281. forwards the lower-bandwidth packet stream to the low-bandwidth sites.
  282.  
  283. After the mixing, the identity of the high-speed site that is speaking can
  284. no longer be determined from the network origin of the packet.  Therefore,
  285. the bridge inserts a CSRC option (Section 5.2.1) into the packet containing
  286. a list of short, locally unique site identifiers to indicate which site(s)
  287. contributed to that mixed packet.  An example of this is shown for bridge B1
  288. in Fig. 1.  As name and location information is received by the bridge in
  289. SDES options from the high-speed sites, that information is passed on to the
  290. receivers along with a mapping to the CSRC identifiers.  This also works
  291. if an RTP packet is mixed through several bridges, with the CSRC value
  292. being mapped into a new locally unique value at each bridge.  For example,
  293. in Fig. 1 bridge B3 maps CSRC value 3 for packets coming from B2 into CSRC
  294. value 1 for packets going to T2.
  295.  
  296.  
  297. 2.3 Translators
  298.  
  299.  
  300. Not all sites are directly accessible through IP multicast.   For these
  301. sites, mixing may not necessary, but a translation of the underlying
  302. transport protocol is.   RTP-level gateways that do not restore timing or
  303. mix packets from different sources are called translators in this document.
  304. Application-level firewalls, for example, will not let any IP packets pass.
  305. Two translators are installed, one on either side of the firewall, the
  306. outside one funneling all multicast packets received through the secure
  307. connection to the translator inside the firewall.   The translator inside
  308. the firewall sends them again as multicast packets to a multicast group
  309. restricted to the site's internal network.   Other examples include the
  310. connection of a group of hosts speaking only IP/UDP to a group of hosts that
  311. understand only ST-II.
  312.  
  313. After RTP packets have passed through a translator, they all carry the
  314. network source address of the translator, making it impossible for the
  315. receiver to distinguish packets from different speakers based on network
  316.  
  317. H. Schulzrinne/S. Casner              Expires 12/31/93              [Page 6]
  318. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  319.  
  320.  
  321.  
  322.       [E1]                                    [E6]
  323.        |                                       |
  324.  E1:17 |                                 E6:15 |
  325.        |                                       |   E6:63/6
  326.        V   B1:48 (1,2)         B1:28/1 (1,2)   V   B1:63/5 (1,2)
  327.       (B1)-------------><T1>-----------------><T2>--------------->[E7]
  328.        ^                 ^     E4:28/2         ^   E4:63/3
  329.   E2:1 |           E4:47 |                     |   B3:63/4 (1,4)
  330.        |                 |                     |
  331.       [E2]              [E4]       B3:89 (1,4) |
  332.                                                |            LEGEND:
  333. [E3] --------->(B2)----------->(B3)------------|          [End system]
  334.        E3:64        B2:12 (3)   ^                         (Bridge)
  335.                                 | E5:45                   <Translator>
  336.                                 |
  337.                                [E5]          source: port/SSRC (CSRCs)
  338.                                              ------------------------>
  339.  
  340.   Figure 1:  Sample RTP network with end systems, bridges and translators
  341.  
  342. source addresses.   Since each sending site has its own sequence number
  343. space and slightly offset timestamp space, the receiver could not properly
  344. mix the audio packets.   (For video, it could not properly separate them
  345. into distinct displays.)   Instead of forcing all senders to include some
  346. globally unique identifier in each packet, a translator inserts an SSRC
  347. option (Section 5.2.2) with a short identifier for the source that is
  348. locally unique to the translator.  This also works if an RTP packet has to
  349. travel through several translators, with the SSRC value being mapped into a
  350. new locally unique value at each translator.  An example is shown in Fig. 1,
  351. where hosts T1 and T2 are translators.  The RTP packets from host E4 are
  352. identified with SSRC value 2, while those coming from bridge B1 are labeled
  353. with SSRC value 1.  Similarly, translator T2 has labeled packets from E6,
  354. B1, E4 and B3 with SSRC values 6, 5, 3 and 4, respectively.
  355.  
  356.  
  357. 2.4 Security
  358.  
  359.  
  360. Conference participants would often like to ensure that nobody else can
  361. listen to their deliberations.  Encryption, indicated by the presence of the
  362. ENC option (Section 5.5.1), provides that privacy.  The encryption method
  363. and key can be changed during the conference by indexing into a table.  For
  364. example, a meeting may go into executive session, protected by a different
  365. encryption key accessible only to a subset of the meeting participants.
  366.  
  367. For authentication, a number of methods are provided, depending on needs and
  368. computational capabilities.  All these message integrity check (MIC) options
  369. (Sections 5.5.3 and following) compute cryptographic checksums, also known
  370.  
  371.  
  372. H. Schulzrinne/S. Casner              Expires 12/31/93              [Page 7]
  373. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  374.  
  375. as message digests, over the RTP data.
  376.  
  377.  
  378. 3 Definitions
  379.  
  380.  
  381. Payload is the data following the RTP fixed header and any RTP/RTCP options.
  382. The payload format and interpretation are beyond the scope of this memo.
  383. RTP packets without payload are valid.  Examples of payload include audio
  384. samples and video data.
  385.  
  386. An RTP packet consists of the encapsulation specific to a particular
  387. underlying protocol, the fixed RTP header, RTP and RTCP options, if any, and
  388. the payload, if any.  A single packet of the underlying protocol may contain
  389. several RTP packets if permitted by the encapsulation method.
  390.  
  391. A (protocol) port is the "abstraction that transport protocols use to
  392. distinguish among multiple destinations within a given host computer.
  393. TCP/IP protocols identify ports using small positive integers." [1] The
  394. transport selectors (TSEL) used by the OSI transport layer are equivalent to
  395. ports.
  396.  
  397. A transport address denotes the combination of network address, e.g., the
  398. 4-octet IP Version 4 address, and the transport protocol port, e.g., the UDP
  399. port.  In OSI systems, the transport address is called transport service
  400. access point or TSAP. The destination transport address may be a unicast or
  401. multicast address.
  402.  
  403. A content source is the actual source of the data carried in an RTP
  404. packet, for example, the application that originally generated some audio
  405. data.  Data from one or more content sources may be combined into a single
  406. RTP packet by a bridge, which becomes the synchronization source (see next
  407. paragraph).  Content source identifiers carried in CSRC options identify the
  408. logical source of the data, for example, to highlight the current speaker in
  409. an audio conference; they have no effect on the delivery or playout timing
  410. of the data itself.  In Fig. 1, E1 and E2 are the content sources of the
  411. data received by E7 from bridge B1, while B1 is the synchronization source.
  412.  
  413. A synchronization source may be a single content source, or the combination
  414. of one or more content sources, produced by a bridge, with its own timing.
  415. Each synchronization source has its own sequence number space.  The audio
  416. coming from a single microphone and the video from a camera are examples
  417. of synchronization sources.  The receiver groups packets by synchronization
  418. source for playback.   Typically a single synchronization source emits a
  419. single medium (e.g., audio or video).  A synchronization source may change
  420. its data format, e.g., audio encoding, over time.  Synchronization sources
  421. are identified by their transport address and the identifier carried in the
  422. SSRC option.  If the SSRC option is absent, a value of zero is assumed for
  423. that identifier.
  424.  
  425.  
  426.  
  427. H. Schulzrinne/S. Casner              Expires 12/31/93              [Page 8]
  428. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  429.  
  430. A transport source is the transport-level origin of the RTP packets as seen
  431. by the receiving end system.  In Fig. 1, host T2, port 63 is the transport
  432. source of all packets received by end system E7.
  433.  
  434. A  channel  comprises  all  synchronization  sources  sending  to  the  same
  435. destination transport address using the same RTP channel ID.
  436.  
  437. An end system generates the content to be sent in RTP packets and consumes
  438. the content of received RTP. An end system can act as one or more
  439. synchronization sources.   (Most end systems are expected to be a single
  440. synchronization source.)  When a packet is transmitted from an end system,
  441. the end system is the content source, synchronization source, and transport
  442. source at that point.
  443.  
  444. An (RTP-level) bridge receives RTP packets from one or more sources,
  445. combines them in some manner and then forwards a new RTP packet.   A
  446. bridge may change the data format.  Since the timing among multiple input
  447. sources will not generally be synchronized, the bridge will make timing
  448. adjustments among the streams and generate its own timing for the combined
  449. stream.  Therefore, when a packet is processed through a bridge, the bridge
  450. becomes the synchronization source as well as the transport source, but the
  451. originating end system remains the content source for that data.  As the
  452. bridge combines packets from multiple content sources into a single outgoing
  453. packet, each of the contributing content sources is noted by the insertion
  454. of an identifier into the CSRC option in the outgoing packet.  Audio bridges
  455. and media converters are examples of bridges.  In Fig. 1, end systems E1
  456. and E2 use the services of bridge B1.   B1 inserts CSRC identifiers for
  457. E1 and E2 when they are active (e.g., talking in an audio conference).
  458. The RTP-level bridges described in this document are unrelated to the data
  459. link-layer bridges found in local area networks.  If there is possibility
  460. for confusion, the term `RTP-level bridge' should be used.  The name bridge
  461. follows common telecommunication industry usage.
  462.  
  463. An (RTP-level) translator forwards RTP packets, but does not alter their
  464. sequence numbers or timestamps.   Examples of its use include encoding
  465. conversion without mixing or retiming, conversion from multicast to unicast,
  466. and application-level filters in firewalls.    A translator is neither
  467. a synchronization nor a content source, but does become the transport
  468. source for packets which flow through it.    The properties of bridges
  469. and translators are summarized in Table 1.   Checkmarks in parentheses
  470. designate possible, but unlikely actions.  The RTP options are explained in
  471. Section 5.2, the RTCP options in Section 6.
  472.  
  473. A synchronization unit consists of one or more packets that are emitted
  474. contiguously by the sender.   The most common synchronization units are
  475. talkspurts for voice and frames for video transmission.   During playout
  476. synchronization, the receiver must reconstruct exactly the time difference
  477. between packets within a synchronization unit (in the case of video, all the
  478. packets of a frame are typically given the same timestamp so there is no
  479. time difference).   The time difference between synchronization units may
  480. be changed by the receiver to compensate for clock drift or to adjust to
  481.  
  482. H. Schulzrinne/S. Casner              Expires 12/31/93              [Page 9]
  483. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  484.  
  485.  
  486.  
  487.                                     end sys. bridge translator
  488.            mix sources                --       x        --
  489.            change encoding            --       x        x
  490.            encrypt                     x       x       (x)
  491.            sign for authentication     x       x        --
  492.            alter content               x       x        x
  493.            insert CSRC (RTP)          --       x        --
  494.            insert SSRC (RTP)          (x)     (x)       x
  495.            insert SDST (RTP)           x       x        --
  496.            insert SDES (RTCP)          x       x        --
  497.  
  498.  
  499.       Table 1:  The properties of end systems, bridges and translators
  500.  
  501. changing network delay jitter.  For example, if audio packets are generated
  502. at fixed intervals during talkspurts, the receiver tries to play back
  503. packets with exactly the same spacing.  However, if, for example, a silence
  504. period between synchronization units (talkspurts) lasts 600 ms, the receiver
  505. may adjust it to, say, 500 ms without this being noticed by the listener.
  506.  
  507. Non-RTP mechanisms refers to other protocols and mechanisms that may be
  508. needed to provide a useable service.    In particular,  for multimedia
  509. conferences,  a conference control application may distribute multicast
  510. addresses  and  keys  for  encryption  and  authentication,  negotiate  the
  511. encryption algorithm to be used,  and determine the mapping from the
  512. RTP  format  field  to  the  actual  data  format  used.      For  simple
  513. applications,  electronic  mail  or  a  conference  database  may  also  be
  514. used.  The specification of such mechanisms is outside the scope of this
  515. memorandum.
  516.  
  517.  
  518. 4 Byte Order, Alignment, and Reserved Values
  519.  
  520.  
  521. All integer fields are carried in network byte order, that is, most
  522. significant byte (octet) first.   This byte order is commonly known as
  523. big-endian.  The transmission order is described in detail in [2], Appendix
  524. A. Unless otherwise noted, numeric constants are in decimal (base 10).
  525. Numeric constants prefixed by `0x' are in hexadecimal.
  526.  
  527. Fields within the fixed header and within options are aligned to the natural
  528. length of the field, i.e., 16-bit words are aligned on even addresses,
  529. 32-bit long words are aligned at addresses divisible by four, etc.  Octets
  530. designated as padding have the value zero.  Fields designated as "reserved"
  531. or R are set aside for future use; they should be set to zero by senders and
  532. ignored by receivers.
  533.  
  534. Textual information is encoded accorded to the UTF-2 encoding of the ISO
  535.  
  536.  
  537. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 10]
  538. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  539.  
  540. standard 10646 (Annex F) [3,4].  US-ASCII is a subset of this encoding and
  541. requires no additional encoding.  The presence of multi-octet encodings is
  542. indicated by setting the most significant bit to a value of one.  An octet
  543. with a binary value of zero may be used as a string terminator for padding
  544. purposes.  However, strings are not required to be zero terminated.
  545.  
  546.  
  547. 5 RTP Data Transfer Protocol
  548.  
  549.  
  550. 5.1 RTP Fixed Header Fields
  551.  
  552.  
  553. The RTP header has the following format:
  554.  
  555.  
  556.  0                   1                   2                   3
  557.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  558. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  559. |Ver| ChannelID |P|S|  format   |       sequence number         |
  560. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  561. |     timestamp (seconds)       |     timestamp (fraction)      |
  562. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  563. | options ...                                                   |
  564. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  565.  
  566.  
  567. The first eight octets are present in every RTP packet and have the
  568. following meaning:
  569.  
  570.  
  571. protocol version: 2 bits
  572.     Identifies the protocol version.  The version number of the protocol
  573.     defined in this memo is one (1).
  574.  
  575. channel ID: 6 bits
  576.     The channel identifier field forms part of the tuple identifying a
  577.     channel (see definition in Section 3) to provide an additional level of
  578.     multiplexing at the RTP layer.   The channel ID field is convenient
  579.     if several different channels are to receive the same treatment by
  580.     the underlying layers or if a profile allows for the concatenation of
  581.     several RTP packets on different channels into a single packet of the
  582.     underlying protocol layer (see Section 8.1).
  583.  
  584. option present bit (P): 1 bit
  585.     This flag has a value of one (1) if the fixed RTP header is followed by
  586.     one or more options and a value of zero (0) otherwise.
  587.  
  588. end-of-synchronization-unit (S): 1 bit
  589.     This flag has a value of one in the last packet of a synchronization
  590.  
  591.  
  592. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 11]
  593. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  594.  
  595.     unit, a value of zero otherwise.  As shown in Appendix A, the beginning
  596.     of a synchronization unit can be readily established from this flag.(2)
  597.  
  598. format: 6 bits
  599.     The format field forms an index into a table defined through the
  600.     RTCP  FMT  option  or  non-RTP  mechanisms  (see  Section  3).     The
  601.     mapping establishes the format of the RTP payload and determines its
  602.     interpretation by the application.   Formats defined through the FMT
  603.     option must be kept in a separate mapping table per sender as there
  604.     can be no guarantee that all senders will use the same table.  If no
  605.     mapping has been defined through these mechanisms, a standard mapping
  606.     is specified by the profile in use by the application in question.  An
  607.     initial set of default mappings for audio and video is specified in
  608.     the companion profile document RFC TBD, and may be extended in future
  609.     editions of the Assigned Numbers RFC.
  610.  
  611. sequence number: 16 bits
  612.     The sequence number counts RTP packets.  The sequence number increments
  613.     by one for each packet sent.   The sequence number may be used by
  614.     the receiver to detect packet loss, to restore packet sequence and to
  615.     identify packets to the application.
  616.  
  617. timestamp: 32 bits
  618.     The timestamp reflects the wall clock time when the RTP packet was
  619.     generated.  Several consecutive RTP packets may have equal timestamps
  620.     if they are generated at once.  The timestamp consists of the middle 32
  621.     bits of a 64-bit NTP timestamp, as defined in RFC 1305 [5].  That is,
  622.     it counts time since 0 hours UTC, January 1, 1900, with a resolution
  623.     of 65536 ticks per second.    (UTC is Coordinated Universal Time,
  624.     approximately equal to the historical Greenwich Mean Time.)  The RTP
  625.     timestamp wraps around approximately every 18 hours.
  626.  
  627.     The timestamp of the first packet within a synchronization unit is
  628.     expected to closely reflect the actual sampling instant,  measured
  629.     by the local system clock.    If possible, the local system clock
  630.     should be controlled by a time synchronization protocol such as NTP.
  631.     However,  it is allowable to operate without synchronized time on
  632.     those systems where it is not available, unless a profile or session
  633.     protocol requires otherwise.   It is not necessary to reference the
  634.     local system clock to obtain the timestamp for the beginning of
  635.     every synchronization unit, but the local clock should be referenced
  636.     frequently enough so that clock drift between the synchronized system
  637.     clock and the sampling clock can be compensated for gradually.  Within
  638.     one synchronization unit, it may be appropriate to compute timestamps
  639.     based on the logical timing relationships between the packets.   For
  640.     audio samples, for example, it is more accurate to maintain the time
  641. ------------------------------
  642.  2. If this flag were to signal the beginning of a synchronization unit
  643. instead, the end of a synchronization unit could not be established in real
  644. time.
  645.  
  646.  
  647. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 12]
  648. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  649.  
  650.     within a synchronization unit in samples, incrementing by the number
  651.     of samples per packet, and then converting to an RTP timestamp (see
  652.     Appendix A.1).
  653.  
  654.  
  655. 5.2 The RTP Options
  656.  
  657.  
  658. The RTP fixed packet header may be followed by options and then the
  659. payload.   Each option consists of the F (final) bit, the option type
  660. designation, a one-octet length field denoting the total number of 32-bit
  661. words comprising the option (including F bit, type and length), followed by
  662. any option-specific data.  The last option before the payload has the F bit
  663. set to one; for all other options this bit has a value of zero.
  664.  
  665. An application may discard options with types unknown to it.  The option
  666. type number range is divided into four regions.   Types 0 through 31 are
  667. general RTP options, their syntax and semantics independent of the format
  668. or any profile.  Types 32 through 63 are RTCP options, again independent
  669. of format and profile.  Types 64 through 95 are specific to a particular
  670. profile, i.e., valid for a range of formats.   Types 96 through 126 are
  671. specific to a format as defined by the four-character name registered
  672. with the Internet Assigned Numbers Authority (IANA); these options may be
  673. described in a profile or format specification.  Format-specific options are
  674. parsed according to the format selected by the format field in the fixed
  675. RTP header, as shown in Appendix A.4.  Types 0 through 126 are reserved and
  676. registered with IANA. Type 127 is defined in Section 5.3 of this document;
  677. it allows application-specific extensions not registered with IANA.
  678.  
  679. Unless otherwise noted, each option may appear only once per packet.  Each
  680. packet may contain any number of options.  Options may appear in any order,
  681. unless specifically restricted by the option description.  In particular,
  682. the position of some security options has significance.
  683.  
  684.  
  685. 5.2.1 CSRC: Content source identifiers
  686.  
  687.  
  688.  0                   1                   2                   3
  689.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  690. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  691. |F|  CSRC = 0   |    length     | content source identifiers   ...
  692. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  693.  
  694. The  CSRC  option,  inserted  only  by  bridges,  lists  all  sources  that
  695. contributed to the packet.  For example, for audio packets, all sources that
  696. were mixed together to create a packet are enumerated, allowing correct
  697. talker indication at the receiver.  The CSRC option may contain one or more
  698. 16-bit content source identifiers.  The identifier values must be unique for
  699. all content sources received from a particular synchronization source on a
  700. particular channel; the value of binary zero is reserved and may not be
  701.  
  702. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 13]
  703. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  704.  
  705. used.  If the number of content sources is even, the two octets needed to
  706. pad the list to a multiple of four octets are set to zero.  There should
  707. be no more than one CSRC option within a packet.   If no CSRC option is
  708. present, the content source identifier is assumed to have a value of zero.
  709. CSRC options are not modified by translators.   If a bridge receives a
  710. packet containing a CSRC option from another bridge located upstream, the
  711. identifier values in that CSRC option must be translated into new, locally
  712. unique values.
  713.  
  714. A conformant RTP implementation does not have to be able to generate or
  715. interpret the CSRC option.
  716.  
  717.  
  718.  
  719. 5.2.2 SSRC: Synchronization source identifier
  720.  
  721.  
  722.  0                   1                   2                   3
  723.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  724. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  725. |F|  SSRC = 1   |  length = 1   |          identifier           |
  726. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  727.  
  728. The SSRC option may be inserted by translators, end systems and bridges.
  729. It is typically used only by translators, but it may be used by an
  730. end system application to distinguish several sources sent with the same
  731. transport source address.  If packets from multiple synchronization sources
  732. will be transmitted with the same transport source address (e.g., the same
  733. IP address and UDP port), an SSRC option must be inserted in each packet
  734. with a distinct identifier for the synchronization source.   Conversely,
  735. synchronization sources that are distinguishable by their transport address
  736. do not require the use of SSRC options.  The SSRC value zero is reserved and
  737. would not normally be transmitted; if received, the SSRC option should be
  738. treated as if not present.  When no SSRC option is present, the transport
  739. source address is assumed to indicate the synchronization source.   There
  740. must be no more than one SSRC option per packet; thus, a translator must
  741. remap the SSRC identifier of an incoming packet into a new, locally unique
  742. SSRC identifier.   The SSRC option can be viewed as an extension of the
  743. source port number in protocols like UDP, ST-II or TCP.
  744.  
  745. An RTP receiver must support the SSRC option.   RTP senders only need to
  746. support this option if they intend to send more than one source to the same
  747. channel using the same source port.  For example, a translator could use
  748. multiple source ports rather than insert SSRC options, but this is likely to
  749. be less convenient.
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 14]
  758. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  759.  
  760. 5.2.3 BOS: Beginning of synchronization unit
  761.  
  762.  
  763.  0                   1                   2                   3
  764.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  765. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  766. |F|   BOS = 3   |   length = 1  |        sequence number        |
  767. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  768.  
  769. The sequence number contained within this option is that of the first
  770. packet within the current synchronization unit.  The BOS option allows the
  771. receiver to compute the offset of a packet with respect to the beginning
  772. of the synchronization unit, even if the last packet of the previous
  773. synchronization unit was lost.  It is expected that many applications will
  774. be able to tolerate such a loss, and so will not use the BOS option but rely
  775. on the S bit.  Those applications which do require the BOS option may use a
  776. profile that specifies it is always included.
  777.  
  778.  
  779.  
  780. 5.3 APP: Application-specific option
  781.  
  782.  
  783.  0                   1                   2                   3
  784.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  785. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  786. |F|  APP = 127  |    length     |            subtype            |
  787. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  788. |                          name (ASCII)                         |
  789. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  790. |                   application-dependent data                 ...
  791. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  792.  
  793.  
  794. subtype: 2 octets
  795.     May be used as a subtype to allow a set of APP options to be defined
  796.     under one unique name, or for any application-dependendent data.
  797.  
  798. name: 4 octets
  799.     A name chosen by the person defining the set of APP options to
  800.     be unique with respect to other APP options this application might
  801.     receive.  The application creator might choose to use the application
  802.     name, and then coordinate the allocation of subtype values to others
  803.     who want to define new options for the application.   Alternatively,
  804.     it is recommended that others choose a name based on the entity they
  805.     represent, then coordinate the use of the name within that entity.
  806.     The name is interpreted as a sequence of four ASCII characters, with
  807.     uppercase and lowercase characters treated as distinct.
  808.  
  809. application-dependent data: variable length
  810.     Application-dependent data may or may not appear in an APP option.  It
  811.  
  812. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 15]
  813. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  814.  
  815.     is interpreted by the application and not RTP itself.
  816.  
  817.  
  818. The APP option is intended for experimental use as new applications and new
  819. features are developed, without requiring option type value registration.
  820. APP options with unrecognized names should be ignored.   After testing
  821. and if wider use is justified, it is recommended that each APP option
  822. be redefined without the subtype and name fields and registered with the
  823. Internet Assigned Numbers Authority using an option type in the RTP, RTCP,
  824. profile-specific, or format-specific range as appropriate.
  825.  
  826.  
  827.  
  828. 5.4 Reverse-Path Option
  829.  
  830.  
  831. With two-party (unicast) communications, having a receiver of data relay
  832. back control information to the sender is straightforward.  Similarly, for
  833. multicast communications, control information can easily be sent to all
  834. members of the group.   It may, however, be desirable to send a unicast
  835. message to a single member of a multicast group, for example to send a
  836. reception quality report.  For such purposes, RTP includes a mechanism for
  837. sending so-called reverse RTP packets.  The format of reverse RTP packets is
  838. exactly the same as for regular RTP packets and they can make use of any
  839. option defined in this memorandum, except SSRC, as appropriate.  The support
  840. for and semantics of particular options are to be specified by a profile or
  841. an individual application.  Additional options may be defined as prescribed
  842. in Section 5.2 as needed for a particular profile, format or application.
  843.  
  844. Reverse RTP packets travel through the same translators as forward RTP
  845. packets.  When RTP is carried in a protocol that provides transport-level
  846. addressing (ports), a site may distinguish reverse RTP packets from forward
  847. RTP packets by their arrival port.  Reverse RTP packets arrive on the same
  848. port that the site uses as a source port for forward (data) RTP packets.
  849. Therefore, that port should be assigned uniquely; in particular, it should
  850. be different than the destination port used with the multicast address,
  851. and if the application is participating in several multicast groups, a
  852. distinct source port should be used to send to each group.   If RTP is
  853. carried directly within IP or some other network-layer protocol that does
  854. not include port numbers, the reverse RTP packet must include an SDST option
  855. (defined next), and the presence of the SDST option signals that the packet
  856. is a reverse RTP packet.
  857.  
  858. A receiver of reverse RTP packets cannot rely on sequence numbers being
  859. consecutive, as a sender is allowed to use the same sequence number space
  860. while communicating through this reverse path with several sites.   In
  861. particular, a receiver of reverse RTP packets cannot tell by the sequence
  862. numbers whether it has received all reverse RTP packets sent to it.   As
  863. a consequence, it is expected that reverse RTP packets would carry only
  864. options and no payload.  The sequence number space of reverse RTP packets
  865. has to be completely separate from that used for RTP packets sent to the
  866.  
  867. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 16]
  868. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  869.  
  870. multicast group.  If the same sequence number space were used, the members
  871. of the multicast group not receiving reverse RTP packets would detect a
  872. gap in their received sequence number space.   The sender of reverse RTP
  873. packets should ensure that sequence numbers are unique, modulo wrap-around,
  874. so that they can, if necessary, be used for matching request and response.
  875. (Currently, no such request-response mechanism has been defined.)   As a
  876. hypothetical example, consider defining a request to pan the remote video
  877. camera.  After completing the request, the receiver of the request would
  878. send a generic acknowledgement containing the sequence number of the request
  879. back to the requestor as an option (not as the packet sequence number in the
  880. fixed header).
  881.  
  882. The timestamp should reflect the approximate sending time of the packet.
  883. The channel ID must be the same as that used in the corresponding forward
  884. RTP packets.
  885.  
  886. If many receivers send a reverse RTP packet in response to a stimulus in the
  887. data stream, for example a request for retransmission of a particular data
  888. frame, the simultaneous delivery of a large number of packets back to the
  889. data source can cause congestion for both the network and the destination
  890. (this is known as an "ack implosion").  Thus reverse RTP packets should be
  891. used with care, perhaps with mechanisms such as response rate limiting and
  892. random delays to spread out the simultaneous delivery.
  893.  
  894.  
  895. 5.4.1 SDST: Synchronization destination identifier
  896.  
  897.  
  898.  0                   1                   2                   3
  899.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  900. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  901. |F|  SDST = 2   |   length = 1  |           identifier          |
  902. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  903.  
  904. The SDST option is only inserted by RTP end systems and bridges if they want
  905. to send a unicast packet to a particular site within the multicast group.
  906. These are called reverse RTP packets.  Only reverse RTP packets may include
  907. the SDST option, but not all reverse RTP packets require it, as explained
  908. below.  A reverse RTP packet must not contain an SSRC option.
  909.  
  910. If a forward RTP packet carries SSRC identifier X when sent from A to
  911. B, where A and B may be either two translators or an end system and a
  912. translator, the unicast reverse RTP packet will carry an SDST option with
  913. identifier X from B to A.
  914.  
  915. Consider the topology shown in Fig. 1.   Assume that RTP is carried over
  916. a network or transport protocol that includes port numbers and that all
  917. forward RTP packets are addressed to destination port 8000.  For the case
  918. that B1 wants to send a reverse packet to E1, B1 simply sends to the source
  919. address and port, that is, port 17 in this example.  E1 can tell by the
  920. arrival on port 17 that the packet is a reverse packet rather than a regular
  921.  
  922. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 17]
  923. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  924.  
  925. (forward) packet.  No SDST option is required.
  926.  
  927. The mechanism is somewhat more complicated when translators intervene.  We
  928. focus on end system E7.  E7 receives, say, video from a range of sources,
  929. E1 through E6 as indicated by the arrows.   The transmission from T2 to
  930. E7 could be either multicast or unicast.  Assume that E7 wants to send a
  931. retransmission request, a request to pan the camera, etc., to end system E4
  932. alone.   E7 may not be able to directly reach E4, as E4 may be using a
  933. network protocol unknown to E7 or be located behind a firewall.  According
  934. to the figure, video transmissions from E4 reach E7 through T2 with source
  935. port 63 and SSRC identifier 3.  For the reverse message, E7 sends a message
  936. to T2, with destination port 63 and SDST identifier 3.   T2 can look up
  937. in its table that it sends forward data coming from T1 with that SSRC
  938. identifier 3.  T2 also knows that those messages from T1 carry SSRC 2 and
  939. arrive with source port 28.  Just like E7, T2 places the SSRC identifier, 2
  940. in this case, into the SDST option and forwards the packet to T1 at port 28.
  941. Finally, translator T1 consults its table to find that it labels packets
  942. coming from E4, port 47 with SSRC value 2 and thus knows to forward the
  943. reverse packet to E4, port 47.  T1 can either place value zero into the SDST
  944. option or remove the option.  Note that E4 cannot directly determine that E7
  945. sent the reverse packet, rather than, say, E6.   If that is important, a
  946. global identifier as defined for the QOS option (Section 6.4) needs to be
  947. included in some option in the reverse packet.
  948.  
  949. When reverse RTP packets are carried directly within IP or some other
  950. network-layer protocol that does not include port numbers, the SDST option
  951. is required to distinguish reverse RTP packets from forward RTP packets.  In
  952. the case where no SSRC identifier needs to be placed in the SDST option, the
  953. value zero should be inserted.
  954.  
  955. Only applications that need to send or receive reverse control RTP packets
  956. need to implement the SDST option.
  957.  
  958.  
  959.  
  960. 5.5 Security Options
  961.  
  962.  
  963. The security options below offer message integrity, authentication and
  964. confidentiality and the combination of the three.  Support for the security
  965. options is not mandatory, but the encryption option (ENC) should at least be
  966. recognized to avoid processing encrypted data.  The four message integrity
  967. check options --- MIC, MICA, MICK and MICS --- are mutually exclusive, i.e.,
  968. only one of them should be used in a single RTP packet.  Multiple options
  969. are provided to satisfy varying security requirements and computational
  970. capabilities.
  971.  
  972. A variety of security services may be provided with the encryption option,
  973. one of the message integrity check options, or the combination of the two
  974. options:
  975.  
  976.  
  977. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 18]
  978. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  979.  
  980. confidentiality: Confidentiality means that only the intended receiver(s)
  981.     can decode the received RTP packets;  for others,  the RTP packet
  982.     contains no useful information.   Confidentiality of the content is
  983.     achieved by encryption.  The presence of encryption and the encryption
  984.     initialization vector is indicated by the ENC option.(3)
  985.  
  986. authentication and message integrity: These  two  security  services  are
  987.     provided by the message integrity check options.   The receiver can
  988.     ascertain that the claimed originator is indeed the originator of the
  989.     data (authentication) and that the data within an RTP packet has not
  990.     been altered after leaving the sender (message integrity).   Through
  991.     examination of the timestamp and sequence number fields in the RTP
  992.     header to verify that all the packets of a sequence are present and
  993.     played in order, an implementation may also establish the integrity of
  994.     that packet sequence.
  995.  
  996.     The  services  offered  by  MICA  and  MIC/MICK/MICS  differ:    With
  997.     MIC/MICK/MICS, the receiver can only verify that the message originated
  998.     within the group holding the secret key, rather than authenticate
  999.     the sender of the message.   The MICA option, in combination with
  1000.     certificates(4),  affords true authentication of the sender.    The
  1001.     certificates for MICA must be distributed through means outside of RTP.
  1002.  
  1003. authentication, message integrity, and confidentiality: By  carrying  both
  1004.     the message integrity check and ENC option in RTP packets,  the
  1005.     authenticity, message integrity and confidentiality of the packet can
  1006.     be assured (subject to the limitations discussed in the previous
  1007.     paragraph).
  1008.  
  1009.     For this combination of security features when group authentication is
  1010.     sufficient, the combination ENC and MIC is recommended (instead of MICS
  1011.     or MICK), as it yields the lowest processing overhead.
  1012.  
  1013.  
  1014. All message integrity check options carry a message digest, which is a
  1015. cryptographic hash function that transforms a message of any length to a
  1016. fixed-length byte string, where the fixed-length string has the property
  1017. that it is computationally infeasible to generate another, different message
  1018. with the same digest.  The message digest is computed over the fixed header,
  1019. ------------------------------
  1020.  3. For efficiency reasons,  this specification does not insist that
  1021. content encryption only be used in conjunction with message integrity and
  1022. authentication mechanisms, in which case there is no guarantee that the
  1023. encrypted data has not been replayed or rearranged.  This also means the
  1024. receiving program may not be able to readily determine whether the data has
  1025. been successfully decrypted, but in most cases, it will be obvious to the
  1026. person receiving the data if he or she does not possess the right encryption
  1027. key.
  1028.  4. For a description of certificates see, for example, RFC 1422 or [6].
  1029.  
  1030.  
  1031. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 19]
  1032. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1033.  
  1034. a portion of the message integrity check option itself (the first two octets
  1035. for MICA, the first four octets for MIC and MICS, or the whole option in
  1036. the case of MICK), and the remaining header options and payload that will
  1037. immediately follow the message integrity check option in the RTP packet.
  1038. The fixed header is protected to foil replay attacks and reassignment to a
  1039. different channel.
  1040.  
  1041. When both a message integrity check option and the ENC option are to be
  1042. included, the recommended ordering is that the message integrity check be
  1043. applied first as described in the previous paragraph.   Then the message
  1044. integrity check option and the remaining header options and payload that
  1045. follow it are encrypted using the shared secret key.   The ENC option is
  1046. prepended to the encrypted data; that is, the ENC option must be followed
  1047. immediately by the message integrity check option, without any other options
  1048. in between.  The receiver first decrypts the octets following the ENC option
  1049. and then authenticates the decrypted data using the message digest contained
  1050. in the message integrity check option.
  1051.  
  1052. For the MIC option in particular, this ordering must be used because the ENC
  1053. option is required to provide confidentiality of the message digest.  For
  1054. the other message integrity check options, this ordering allows explicit
  1055. detection of an encryption key mismatch.  However, both the decryption and
  1056. message integrity check functions must be performed before an invalid packet
  1057. can be detected, which increases the potential for a denial-of-service
  1058. attack.  For those applications where this is a concern, the ordering may be
  1059. reversed.
  1060.  
  1061. The message integrity check options and the ENC option must not cover the
  1062. SSRC or SDST option, i.e., SSRC or SDST must be inserted between the fixed
  1063. header and the ENC or message integrity check option; SSRC and SDST are
  1064. subject to change by translators that likely do not possess the necessary
  1065. descriptor table (see below) and encryption keys.   Trusted translators
  1066. that have the necessary keys and descriptor translation table may modify
  1067. the contents of the RTP packet, unless the MICA option is used (see MICA
  1068. description in Section 5.5.3).
  1069.  
  1070. All security options except MICA carry a one-octet descriptor field.  These
  1071. descriptors are indexes into two tables, one for the message integrity
  1072. check options and one for the ENC option, established by non-RTP means to
  1073. contain the digest algorithms (MD2, MD5, etc.), encryption algorithms (DES
  1074. variants) and encryption keys or shared secrets (for the MICK option) to be
  1075. used during a session.  The descriptor value may change during a session,
  1076. for example, to switch to a different encryption key.  The tables must be
  1077. established to be the same for all sources within the same channel; this
  1078. reduces per-site state information.
  1079.  
  1080. The descriptor value zero selects a set of default algorithms, namely,
  1081. MD5 for the message digest algorithm and DES in CBC mode for encryption
  1082. algorithm, so that basic security features may be implemented using simple
  1083. non-RTP mechanisms to communicate a single shared secret (key).    For
  1084. example, the key might be communicated by telephone or (private) email and
  1085.  
  1086. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 20]
  1087. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1088.  
  1089. entered manually.
  1090.  
  1091.  
  1092. 5.5.1 ENC: Encryption
  1093.  
  1094.  
  1095.  0                   1                   2                   3
  1096.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1097. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1098. |F|   ENC = 8   |   length = 3  |    reserved   |   descriptor  |
  1099. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1100. |      DES (CBC) initialization vector, bytes 0 through 3       |
  1101. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1102. |      DES (CBC) initialization vector, bytes 4 through 7       |
  1103. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1104.  
  1105. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1106. |F|   ENC = 8   |   length = 1  |    reserved   |   descriptor  |
  1107. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1108.  
  1109.  
  1110. Every encrypted RTP packet must contain this option in one of the two forms
  1111. shown.   All octets in the packet following this option are encrypted,
  1112. using the encryption key and symmetric encryption algorithm selected by the
  1113. descriptor field.  Note that the fixed header is specifically not encrypted
  1114. because some fields must be interpreted by translators that will not have
  1115. access to the key.  The descriptor value may change over time to accommodate
  1116. varying security requirements or limit the amount of ciphertext using the
  1117. same key.  For example, in a job interview conducted across a network, the
  1118. candidate and interviewers could share one key, with a second key set aside
  1119. for the interviewers only.  For symmetric keys, source-specific keys offer
  1120. no advantage.
  1121.  
  1122. The descriptor value zero is reserved for a default mode using the Data
  1123. Encryption Standard (DES) algorithm in CBC (cipher block chaining) mode,
  1124. as described in Section 1.1 of RFC 1423 [7].   The padding specified in
  1125. that section is to be used.   In the first form of the ENC option, the
  1126. 8-octet initialization vector (IV) is carried unencrypted within the option,
  1127. but must be generated uniquely for each packet.    In the second form
  1128. (indicated by an option length of one), the ENC option does not contain
  1129. an initialization vector and instead the fixed RTP header is used as the
  1130. initialization vector.  (Using the fixed RTP header as the initialization
  1131. vector avoids regenerating the initialization vector for each packet and
  1132. incurs less header overhead; it is unique for a period of at least 18
  1133. hours.)   For details on the tradeoffs for CBC initialization vector use,
  1134. see [8].   Support for encryption is not required.   Implementations that
  1135. do not support encryption should recognize the ENC option so that they
  1136. can avoid processing encrypted messages and provide a meaningful failure
  1137. indication.  Implementations that support encryption should, at the minimum,
  1138. always support the DES algorithm in CBC mode.
  1139.  
  1140.  
  1141. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 21]
  1142. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1143.  
  1144. 5.5.2 MIC: Messsage integrity check
  1145.  
  1146.  
  1147.  0                   1                   2                   3
  1148.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1149. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1150. |F|   MIC = 9   |     length    |    reserved   |   descriptor  |
  1151. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1152. |                 message digest (unencrypted)                 ...
  1153. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1154.  
  1155.  
  1156. The MIC option option is used only in combination with the ENC option
  1157. immediately preceding it to provide confidentiality, message integrity and
  1158. group membership authentication.   The message integrity check uses the
  1159. digest algorithm selected by the descriptor field.  The value zero implies
  1160. the use of the MD5 message digest.   Note that the MIC option is not
  1161. separately encrypted.
  1162.  
  1163.  
  1164.  
  1165. 5.5.3 MICA: Message integrity check, asymmetric encryption
  1166.  
  1167.  
  1168.  0                   1                   2                   3
  1169.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1170. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1171. |F|  MICA = 10  |    length     |         message digest       ...
  1172. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1173. |                    (asymmetrically encrypted)                ...
  1174. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1175.  
  1176. The message digest is asymmetrically encrypted using the sender's private
  1177. key according to the algorithm defined for Privacy Enhanced Mail, described
  1178. in Section 4.2.1 of RFC 1423 (here "MIC" denotes the general term "message
  1179. integrity check", not the RTP option):
  1180.  
  1181.  
  1182.     As described in PKCS #1, all quantities input as data values to the
  1183.     RSAEncryption process shall be properly justified and padded to the
  1184.     length of the modulus prior to the encryption process.  In general,
  1185.     an RSAEncryption input value is formed by concatenating a leading
  1186.     NULL octet, a block type BT, a padding string PS, a NULL octet, and
  1187.     the data quantity D, that is, RSA input value = 0x00, BT, PS, 0x00,
  1188.     D. To prepare a MIC for RSAEncryption, the PKCS #1 "block type 01"
  1189.     encryption-block formatting scheme is employed.  The block type BT
  1190.     is a single octet containing the value 0x01 and the padding string
  1191.     PS is one or more octets (enough octets to make the length of the
  1192.     complete RSA input value equal to the length of the modulus) each
  1193.     containing the value 0xFF. The data quantity D is comprised of the
  1194.     MIC and the MIC algorithm identifier which are ASN.1 encoded.
  1195.  
  1196. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 22]
  1197. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1198.  
  1199. For the purposes of the MICA option, the encoding of data quantity D
  1200. may be considered as a fixed binary sequence identifying the message
  1201. integrity check algorithm, followed by the octets of the message digest.
  1202. Currently, only the use of the MD2 and MD5 algorithms is defined, as
  1203. described in RFC 1319 [9] (as corrected in Section 2.1 of RFC 1423) and RFC
  1204. 1321 [10], respectively.  For MD2, the fixed binary sequence (shown here
  1205. in hexadecimal) is 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48,
  1206. 0x86, 0xF7, 0x0D, 0x02, 0x02, 0x05, 0x00, 0x04, 0x10, and for MD5 it is
  1207. 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
  1208. 0x02, 0x05, 0x05, 0x00, 0x04, 0x10.  The appropriate sequence is followed
  1209. immediately by the message digest, which is 16 octets long for both MD2 and
  1210. MD5.  For clarification of the octet ordering of the message digest, see RFC
  1211. 1423, Sections 2.1 and 2.2.
  1212.  
  1213. As an example, for an RSA encryption modulus length of 512 bits or 64
  1214. octets, the RSA input value would be:
  1215.  
  1216.  
  1217.            BT  <---- PS --->      <------------ D ------------->
  1218.      0x00 0x01 0xFF ... 0xFF 0x00 0x30 ... 0x10 [message digest]
  1219.                 (29 octets)        (18 octets)     (16 octets)
  1220.  
  1221. The length of the encrypted message digest will be equal to the modulus
  1222. of the RSA encryption used, rounded to the next integral octet count.
  1223. Contrary to what is specified in RFC 1423 for Privacy Enhanced Mail,
  1224. the asymmetrically encrypted message digest is carried in binary, not
  1225. represented in the printable encoding of RFC 1421, Section 4.3.2.4.  The
  1226. encrypted message digest is inserted into the MICA option immediately
  1227. following the length octet, and is padded at the end to make the MICA
  1228. option a multiple of four octets long.  The value of the padding is left
  1229. unspecified.  The number of non-padding bits within the signature is known
  1230. to the receiver as being equal to the key length.
  1231.  
  1232. The modulus and public key are conveyed to the receivers by non-RTP means.
  1233. After the message digest is decrypted, the message integrity check algorithm
  1234. is identified through the octets prepended to the actual 16-octet digest.
  1235.  
  1236. Asymmetric keys are used since symmetric keys would not allow authentication
  1237. of the individual source in the multicast case.  A translator is not allowed
  1238. to modify the parts of an RTP packet covered by the MICA option as the
  1239. receiver would have no way of establishing the identity of the translator
  1240. and thus could not verify the integrity of the RTP packet.
  1241.  
  1242.  
  1243.  
  1244. 5.5.4 MICK: Message integrity check, keyed
  1245.  
  1246.  
  1247.  0                   1                   2                   3
  1248.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1249. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1250.  
  1251. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 23]
  1252. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1253.  
  1254. |F|  MICK = 11  |    length     |   reserved    |   descriptor  |
  1255. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1256. |           message digest (including shared secret)           ...
  1257. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1258.  
  1259. This message integrity check option does not require encryption,  but
  1260. includes a shared secret in the computation of the message digest.   The
  1261. shared secret is equivalent to the key used for the MICS and ENC options,
  1262. but is 16 octets long, padded if needed with binary zeroes.   The shared
  1263. secret is first placed into the MICK option where the message will later go,
  1264. then the digest is computed over the fixed RTP header, the whole MICK option
  1265. including the shared secret, and the remaining header options and payload
  1266. that will immediately follow the MICK option in the RTP packet.  The shared
  1267. secret in the MICK option is then replaced by the computed 16-octet message
  1268. digest for transmission.
  1269.  
  1270. The receiver stores the message digest contained in the MICK option,
  1271. replaces it with the shared secret key and computes the message digest in
  1272. the same manner as the sender.   If the RTP packet has not been tampered
  1273. with and has originated with one of the holders of the shared secret, the
  1274. computed message digest will agree with the digest found on reception in the
  1275. MICK option.(5)
  1276.  
  1277. The digest algorithm and shared secret are selected by the descriptor field.
  1278. The value zero implies the use of the MD5 message digest and a single shared
  1279. secret.
  1280.  
  1281.  
  1282.  
  1283. 5.5.5 MICS: Message integrity check, symmetric-key encrypted
  1284.  
  1285.  
  1286.  0                   1                   2                   3
  1287.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1288. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1289. |F|  MICS = 12  |    length     |   reserved    |   descriptor  |
  1290. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1291. |           message digest (symmetrically encrypted)           ...
  1292. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1293.  
  1294. This message integrity check encrypts the message digest using the DES
  1295. algorithm in ECB mode as described in RFC 1423, Section 3.1.  The digest
  1296. ------------------------------
  1297.  5. This message integrity check follows the practice of SNMP Version 2,
  1298. as described in RFC 1446, Section 1.5.1.   Using the secret key in the
  1299. computation of the message digest instead of encrypting the digest avoids
  1300. the use of an encryption algorithm when only integrity and authentication
  1301. are desired.  However, the security of this approach has not been as well
  1302. established as the authentication based on encrypting message digests used
  1303. in the MICS, MIC and MICA options.
  1304.  
  1305.  
  1306. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 24]
  1307. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1308.  
  1309. algorithm and symmetric key are selected by the descriptor field.  The value
  1310. zero implies the use of the MD5 message digest and a single key.
  1311.  
  1312.  
  1313.  
  1314. 6 RTP Control Protocol --- RTCP
  1315.  
  1316.  
  1317. The RTP control protocol (RTCP) conveys minimal control and advisory
  1318. information during a session.  It provides support for "loosely controlled"
  1319. sessions,  i.e.,  where participants enter and leave without membership
  1320. control and parameter negotiation.  The services provided by RTCP augment
  1321. RTP, but an end system does not have to implement RTCP features to
  1322. participate in sessions.   There is one exception to this rule:   if an
  1323. application sends FMT options, the receiver has to decode these in order
  1324. to properly interpret the RTP payload.   RTCP does not aim to provide
  1325. the services of a session control protocol and does not provide some of
  1326. the services desirable for two-party conversations.  If a session control
  1327. protocol is in use, the services of RTCP should not be required.  (As of the
  1328. writing of this document, a session or conference control protocol has not
  1329. been specified within the Internet.)
  1330.  
  1331. RTCP options share the same structure and numbering space as RTP options,
  1332. which are described in Section 5.    Unless otherwise noted,  control
  1333. information is carried periodically as options within RTP packets, with
  1334. or without payload.   RTCP packets are sent to all members of a session,
  1335. typically using multicast.   These packets are part of the same sequence
  1336. number space as RTP packets not containing RTCP options.  The period should
  1337. be varied randomly to avoid synchronization of all sources and its mean
  1338. should increase with the number of participants in the session to limit the
  1339. growth of the overall network and host interrupt load.  The length of the
  1340. period determines, for example, how long a receiver joining a session has
  1341. to wait until it can identify the source.  A receiver may remove from its
  1342. list of active sites a site that it has not been heard from for a given
  1343. time-out period; the time-out period may depend on the number of sites or
  1344. the observed average interarrival time of RTCP messages.   Note that not
  1345. every periodic message has to contain all RTCP options; for example, the
  1346. EMAIL part within the SDES option might only be sent every few messages.
  1347. RTCP options should also be sent when information carried in RTCP options
  1348. changes, but the generation of RTCP options should be rate-limited.
  1349.  
  1350.  
  1351. 6.1 FMT: Format description
  1352.  
  1353.  
  1354.  0                   1                   2                   3
  1355.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1356. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1357. |F|  FMT = 32   |    length     |R|R|  format   |    reserved   |
  1358. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1359.  
  1360.  
  1361. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 25]
  1362. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1363.  
  1364. |                          format name                          |
  1365. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1366. |                    format-dependent data                     ...
  1367. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1368.  
  1369.  
  1370. format: 6 bits
  1371.     The format field corresponds to the index value from the format field
  1372.     in the RTP fixed header, with values ranging from 0 to 63.
  1373.  
  1374. format name: 4 octets
  1375.     The format name describes the format in an unambiguous way and is
  1376.     registered with the Internet Assigned Numbers Authority.   The format
  1377.     name is interpreted as a sequence of four ASCII characters, with
  1378.     uppercase and lowercase characters treated as distinct.  Format names
  1379.     beginning with the letter 'X' are reserved for experimental use and not
  1380.     subject to registration.
  1381.  
  1382. format-dependent data: variable length
  1383.     Format-dependent data may or may not appear in a FMT option.  It is
  1384.     interpreted by the application and not RTP itself.
  1385.  
  1386.  
  1387. A FMT mapping changes the interpretation of a given format value carried in
  1388. the fixed RTP header starting at the packet containing the FMT option.  The
  1389. new interpretation applies only to packets from the same synchronization
  1390. source as the packet containing the FMT option.   If format mappings are
  1391. changed through the FMT option, the option should be sent periodically as
  1392. otherwise sites that did not receive the FMT option due to packet loss or
  1393. joining the session after the FMT option was sent will not know how to
  1394. interpret the particular format value.
  1395.  
  1396.  
  1397.  
  1398. 6.2 SDES: Source descriptor
  1399.  
  1400.  
  1401.  0                   1                   2                   3
  1402.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1403. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1404. |F|  SDES = 34  |    length     |       source identifier       |
  1405. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1406.  
  1407. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1408. | type=PORT (2) |   length = 1  |             port              |
  1409. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1410. | type=ADDR (1) |    length     |    reserved   | address type  |
  1411. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1412. |                     network-layer address                    ...
  1413. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1414.  
  1415.  
  1416. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 26]
  1417. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1418.  
  1419.  
  1420. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1421. | type=PORT (2) |   length > 1  |    reserved   |    reserved   |
  1422. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1423. |                             port                             ...
  1424. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1425.  
  1426. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1427. | type=CNAME (4)|    length     | user and domain name         ...
  1428. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1429.  
  1430. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1431. | type=EMAIL (5)|    length     | electronic mail address      ...
  1432. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1433.  
  1434. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1435. | type=NAME (6) |    length     | common name of source        ...
  1436. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1437.  
  1438. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1439. | type=LOC (8)  |    length     | geographic location of site  ...
  1440. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1441.  
  1442. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1443. | type=TXT (16) |    length     | text describing source       ...
  1444. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1445.  
  1446. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1447. | type=PRIV(255)|   length > 1  |            subtype            |
  1448. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1449. |                          name (ASCII)                         |
  1450. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1451. |                 application-defined content                  ...
  1452. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1453.  
  1454. The SDES option is composed of the first four octets shown concatenated
  1455. with one or more of the subsequent items as described individually below.
  1456. SDES provides a mapping between a numeric source identifier and those items,
  1457. which describe a particular source.(6)   For those applications where the
  1458. size of a multi-item SDES option would be a concern, multiple SDES options
  1459. may be formed with subsets of the items to be sent in separate packets.
  1460.  
  1461. When an SDES option originates from a content source (the actual source
  1462. of the data), the identifier value is zero.   If the data flows through
  1463. a bridge, the bridge forwards the SDES information, but changes the SDES
  1464. source identifier to the value used in the CSRC option when identifying
  1465. ------------------------------
  1466.  6. Several attributes were combined into one option so that the receiver
  1467. does not have to perform multiple mappings from identifiers to site data
  1468. structures.
  1469.  
  1470.  
  1471. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 27]
  1472. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1473.  
  1474. that content source.  The bridge may choose to store the SDES information
  1475. received from a content source and change then number of items sent together
  1476. or the rate at which SDES information is sent.  A bridge uses an identifier
  1477. value of zero within an SDES option to describe itself rather than the
  1478. content sources bridged by it, but if a bridge contributes local data to
  1479. outgoing packets, it should select another non-zero source identifier for
  1480. that traffic and send CSRC and SDES options for it as well.
  1481.  
  1482. Translators do not modify or insert SDES options.  The end system performs
  1483. the same mapping it uses to identify the content sources (that is, the
  1484. combination of transport source, SSRC identifier and the source identifier
  1485. within this SDES option) to identify a particular source.  SDES information
  1486. is specific to traffic from a source on a particular channel, unless a
  1487. profile or a higher-layer control protocol defines that the same SDES
  1488. describes traffic from that source on some set of channels.
  1489.  
  1490. Each item has a structure similar to that of RTP and RTCP options, that is,
  1491. a type field followed by a length field, measured in multiples of four
  1492. octets.  No final bit (see Section 5.2) is needed since the overall length
  1493. is known.   Item types 0 through 127 apply to all profiles, while types
  1494. 128 through 254 are allocated to profile-specific items; both ranges are
  1495. reserved and registered with the Internet Assigned Numbers Authority (IANA).
  1496. Item type 255 (PRIV) is provided for private or experimental extensions not
  1497. registered with IANA. Items are independent of the format value.
  1498.  
  1499. All of the SDES items are optional and unrecognized items may be ignored;
  1500. however, if quality-of-service monitoring is to be used, receivers will
  1501. require the PORT and ADDR items from the SDES option in order to construct
  1502. the QOS option.   Only the TXT item is expected to change during the
  1503. duration of a session.  Text items are encoded according to the rules in
  1504. Section 4.  Items are padded with the binary value zero to the next multiple
  1505. of four octets.  Each item may appear only once unless otherwise noted.  A
  1506. description of the content of these items follows:
  1507.  
  1508.  
  1509. PORT/ADDR: The PORT item contains the source transport selector, such as
  1510.     the UDP source port number, and the ADDR item contains the network
  1511.     address of the source, for example, the IP version 4 address or an
  1512.     NSAP. Both are carried in binary form, not as "dotted decimal" or
  1513.     similar human-readable form.   Address types are identified by the
  1514.     Domain Name Service Resource Record (RR) type, as specified in the
  1515.     current edition of the Assigned Numbers RFC.
  1516.  
  1517.     There must be no more than one PORT item in an SDES option.  The PORT
  1518.     item should be followed immediately by an ADDR item.   Concatenated,
  1519.     these two items serve as a globally unique identifier for the source
  1520.     which is returned in the QOS option.  As far as RTP is concerned, this
  1521.     identifier is opaque, so it is unimportant which address is used for
  1522.     multi-homed hosts.  Applications may find the address or port useful
  1523.     for debugging or monitoring, but should not assume that the combination
  1524.     can be used to communicate with the source process because it may be on
  1525.  
  1526. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 28]
  1527. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1528.  
  1529.     the other side of a firewall or using a different transport protocol.
  1530.     If it is useful to the application, it is permissible for a source
  1531.     to include additional ADDR items after the first to convey additional
  1532.     addresses if the source is multi-homed, or if the source's address may
  1533.     be represented in multiple schemes, for example during the transition
  1534.     from IPv4 to IPng.(7)
  1535.  
  1536.     The figure shows the PORT item in two forms.  The first form shows the
  1537.     concatenated PORT and ADDR items as they would be used for the TCP
  1538.     and UDP protocols.  For an IPv4 address, the length of the ADDR item
  1539.     would be 2, and the address type would be 1.  The second form of the
  1540.     PORT item is indicated by a length field greater than one and is used
  1541.     when the transport selector (port number) is larger than two octets.
  1542.     Octets three and four of the item are reserved (zero) and the transport
  1543.     selector appears in words two and following of this item, in network
  1544.     byte order.
  1545.  
  1546. CNAME: Canonical user and host identifier, e.g.,
  1547.  
  1548.  
  1549.               "doe@sleepy.megacorp.com" or "sleepy.megacorp.com".
  1550.  
  1551.  
  1552.     The CNAME item must have the format "user@host" or "host", where
  1553.     "host" is the fully qualified domain name of the host from which the
  1554.     real-time data originates, formatted according to the rules specified
  1555.     in RFC 1034, RFC 1035 and Section 2.1 of RFC 1123.    The "host"
  1556.     form may be used if a user name is not available, for example on
  1557.     single-user systems.    The user name should be in a form that a
  1558.     program such as "finger" or "talk" could use, i.e., it typically is
  1559.     the login name rather than the real-life name.   Note that the host
  1560.     name is not necessarily identical to the electronic mail address of the
  1561.     participant.
  1562.  
  1563. EMAIL: User's electronic mail address, formatted according to RFC 822, for
  1564.     example,
  1565.  
  1566.  
  1567.                             "John.Doe@megacorp.com".
  1568.  
  1569.  
  1570. NAME: Common name describing the source, e.g., "John Doe, Bit Recycler,
  1571.     Megacorp".   This name may be in any form desired by the user.   For
  1572.     applications such as conferencing, this form of name may be the most
  1573.     desirable for display in participant lists, and therefore might be sent
  1574.     most frequently (profiles may establish such priorities).
  1575. ------------------------------
  1576.  7. The ordering simplifies processing at the receiver, as the consecutive
  1577. octet string of PORT followed by the first ADDR can be stored as the
  1578. globally unique identifier.
  1579.  
  1580.  
  1581. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 29]
  1582. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1583.  
  1584. LOC: Geographic user location.   Depending on the application, different
  1585.     degrees of detail are appropriate for this item.    For conference
  1586.     applications,  a  string  like  "Murray  Hill,  New  Jersey"  may  be
  1587.     sufficient, while, for an active badge system, strings like "Room
  1588.     2A244, AT&T BL MH" might be appropriate.   The degree of detail is
  1589.     left to the implementation and/or user, but format and content may be
  1590.     prescribed by a profile.
  1591.  
  1592. TXT: Text describing the source, e.g., "out for lunch".
  1593.  
  1594. PRIV: Private, unregistered items.  The subtype and name fields are to be
  1595.     used in the same manner as in the APP option (Section 5.3).  The format
  1596.     and content of the octets following the name field are determined by
  1597.     the application defining the item.
  1598.  
  1599.  
  1600.  
  1601.  
  1602. 6.3 BYE: Goodbye
  1603.  
  1604.  
  1605.  0                   1                   2                   3
  1606.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1607. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1608. |F|   BYE = 35  | length = 1    |   content source identifier   |
  1609. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1610.  
  1611. The BYE option indicates that a particular session participant is no longer
  1612. active.   When a BYE option originates from a content source (the actual
  1613. source of the data), the identifier value is zero.    If the message
  1614. flows through a bridge, the bridge forwards the BYE message, but changes
  1615. the identifier to be the (non-zero) value used in the CSRC option when
  1616. identifying that content source.  If a bridge shuts down, it should first
  1617. send BYE options for all content sources it handles, followed by a BYE
  1618. option with an identifier value of zero.  An RTCP message may contain more
  1619. than one BYE option.  Multiple identifiers in a single BYE option are not
  1620. allowed, to avoid ambiguities between the special value of zero and any
  1621. necessary padding.
  1622.  
  1623.  
  1624.  
  1625. 6.4 QOS: Quality of service measurement
  1626.  
  1627.  
  1628.  0                   1                   2                   3
  1629.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1630. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1631. |F|  QOS = 36   |    length     |    reserved   |    reserved   |
  1632. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1633. |                       packets expected                        |
  1634.  
  1635.  
  1636. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 30]
  1637. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1638.  
  1639. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1640. |                       packets received                        |
  1641. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1642. |    minimum delay (seconds)    |    minimum delay (fraction)   |
  1643. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1644. |    maximum delay (seconds)    |    maximum delay (fraction)   |
  1645. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1646. |    average delay (seconds)    |    average delay (fraction)   |
  1647. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1648. | type=PORT (2) |    length     |   transport address          ...
  1649. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1650. | type=ADDR (1) |    length     |    reserved   | address type  |
  1651. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1652. |                     network-layer address                    ...
  1653. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1654.  
  1655.  
  1656. The QOS option conveys statistics on the reception of packets from a single
  1657. synchronization source on a single channel.  These statistics are the number
  1658. of packets received, the number of packets expected, the minimum delay, the
  1659. maximum delay and the average delay.  The expected number of packets may be
  1660. computed according to the algorithm in Section A.5.  The delay measures are
  1661. in units of 1/65536 of a second, that is, with the same resolution as the
  1662. timestamp in the fixed RTP header.
  1663.  
  1664. The  synchronization  source  to  which  these  statistics  correspond  is
  1665. identified by appending to the fixed-length part of the QOS option the
  1666. PORT and ADDR items, in that order, as received in an SDES option from
  1667. that source.   Together, the PORT and ADDR items form a globally unique
  1668. identifier (as described with the SDES option, Section 6.2).  If the source
  1669. has supplied more than one ADDR item, only the first one from the SDES (the
  1670. one immediately following the PORT item) is used.  If no SDES option, or
  1671. none with PORT and ADDR items, has been received from a particular source,
  1672. the QOS option cannot be sent unless the PORT and ADDR items are known by
  1673. some other mechanism.
  1674.  
  1675. The QOS option may be sent in either normal (forward) or reverse RTP
  1676. packets.    In the first case,  the channel to which these statistics
  1677. correspond is same as the channel on which the QOS option is sent; that is,
  1678. the channel is identified by the destination (multicast or unicast) address,
  1679. destination port and channel ID. If the QOS option is sent in a reverse RTP
  1680. packet, the channel is identified by the channel ID in the header and the
  1681. destination port number as the packet arrives at the synchronization source,
  1682. which will be the same port that the source uses to send data on that
  1683. channel, as described in Section 5.4.  Sending the QOS option by multicast
  1684. has the advantage that all participants in the session can compare their
  1685. reception to that of others, and allows participants to adjust the rate at
  1686. which QOS is sent based on the number of participants.
  1687.  
  1688. A single RTCP packet may contain several QOS options for different sources.
  1689. It is left to the implementor to decide how often to transmit QOS options
  1690.  
  1691. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 31]
  1692. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1693.  
  1694. and which sources are to be included.
  1695.  
  1696.  
  1697.  
  1698. 7 Security Considerations
  1699.  
  1700.  
  1701. RTP suffers from the same security liabilities as the underlying protocols.
  1702. For example, an impostor can fake source or destination network addresses,
  1703. or change the header or payload.  For example, the SDES fields may be used
  1704. to impersonate another participant.  In addition, RTP may be sent via IP
  1705. multicast, which provides no direct means for a sender to know all the
  1706. receivers of the data sent and therefore no measure of privacy.  Rightly or
  1707. not, users may be more sensitive to privacy concerns with audio and video
  1708. communication than they have been with more traditional forms of network
  1709. communication [11].  Therefore, the use of security mechanisms with RTP is
  1710. important.
  1711.  
  1712. As a first step, RTP options make it easy for all participants in a session
  1713. to identify themselves; if deemed important for a particular application, it
  1714. is the responsibility of the application writer to make listening without
  1715. identification difficult.  It should be noted, however, that privacy of the
  1716. payload can generally be assured only by encryption.
  1717.  
  1718. The security options described in Section 5.5 can be used to implement
  1719. message integrity, authentication and confidentiality and the combination of
  1720. the three.  These security services might also be provided at the IP layer
  1721. as security mechanisms are developed for that layer.
  1722.  
  1723. The periodic transmission of SDES options from sources that are otherwise
  1724. idle may make it possible to detect denial-of-service attacks, as the
  1725. receiver can detect the absence of these expected messages.  The messages
  1726. that are received must be verified for integrity and authenticated before
  1727. being accepted for this purpose.
  1728.  
  1729. Unlike for other data, ciphertext-only attacks may be more difficult for
  1730. compressed audio and video sources.   Such data is very close to white
  1731. noise, making statistics-based ciphertext-only attacks difficult.   Even
  1732. without message integrity check options,  it may be difficult for an
  1733. attacker to detect automatically when he or she has found the secret
  1734. cryptographic key since the bit pattern after correct decryption may
  1735. not look significantly different from one decrypted with the wrong key.
  1736. However, the session information is more or less constant and predictable,
  1737. allowing known-plaintext attacks.    Chosen-plaintext attacks appear, in
  1738. general, to be difficult.
  1739.  
  1740. The integrity of the timestamp in the fixed RTP header can be protected by
  1741. the message integrity options.  If clocks are known to be synchronized, an
  1742. attacker only has a very limited time window of maybe a few seconds every 18
  1743. hours to replay recorded RTP without detection by the receiver.
  1744.  
  1745.  
  1746. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 32]
  1747. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1748.  
  1749. Key  distribution  and  certificates  are  outside  the  scope  of  this
  1750. document.
  1751.  
  1752.  
  1753. 8 RTP over Network and Transport Protocols
  1754.  
  1755.  
  1756. This section describes issues specific to carrying RTP packets within
  1757. particular network and transport protocols.
  1758.  
  1759.  
  1760. 8.1 Defaults
  1761.  
  1762.  
  1763. The following rules apply unless superseded by protocol-specific subsections
  1764. in this section.  The rules apply to both forward and reverse RTP packets.
  1765.  
  1766. RTP packets contain no length field or other delineation, therefore a
  1767. framing mechanism is needed if they are carried in underlying protocols that
  1768. provide the abstraction of a continuous bit stream rather than messages
  1769. (packets).  TCP is an example of such a protocol.  Framing is also needed
  1770. if the underlying protocol may contain padding so that the extent of the
  1771. RTP payload cannot be determined.   For these cases, each RTP packet is
  1772. prefixed by a 32-bit framing field containing the length of the RTP packet
  1773. measured in octets, not including the framing field itself.   If an RTP
  1774. packet traverses a path over a mixture of octet-stream and message-oriented
  1775. protocols, each RTP-level bridge between these protocols is responsible for
  1776. adding and removing the framing field.
  1777.  
  1778. A profile may specify that this framing method is to be used even when RTP
  1779. is carried in protocols that do provide framing in order to allow carrying
  1780. several RTP packets in one lower-layer protocol data unit, such as a UDP
  1781. packet.   Carrying several RTP packets in one network or transport packet
  1782. reduces header overhead and may simplify synchronization between different
  1783. streams.
  1784.  
  1785.  
  1786. 8.2 ST-II
  1787.  
  1788.  
  1789. When used in conjunction with RTP, ST-II [12] service access ports (SAPs)
  1790. have a length of 16 bits.   The next protocol field (NextPCol, Section
  1791. 4.2.2.10 in RFC 1190) is used to distinguish two encapsulations of RTP over
  1792. ST-II. The first uses NextPCol value TBD and directly places the RTP packet
  1793. into the ST-II data area.  If NextPCol value TBD is used, the RTP header is
  1794. preceded by a 32-bit header shown below.  The octet count determines the
  1795. number of octets in the RTP header and payload to be checksummed, allowing
  1796. the checksum to cover only the header if it is preferred to ignore errors in
  1797.  
  1798.  
  1799.  
  1800.  
  1801. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 33]
  1802. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1803.  
  1804. the data.  The 16-bit checksum uses the TCP and UDP checksum algorithm.
  1805.  
  1806.  
  1807.  0                   1                   2                   3
  1808.  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1809. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1810. | count of octets to be checked |            checksum           |
  1811. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1812. |       RTP packet (fixed header, options and payload)         ...
  1813. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1814.  
  1815.  
  1816. 9 RTP Profiles
  1817.  
  1818.  
  1819. RTP may be used for a variety of applications with somewhat differing
  1820. requirements.  The flexibility to adapt to those requirements is provided by
  1821. allowing multiple choices in the main protocol specification, then defining
  1822. a profile to select the appropriate choices for a particular class of
  1823. applications and environment.  A profile for audio and video applications
  1824. may be found in the companion Internet draft draft-ietf-avt-profile.
  1825.  
  1826. Within this specification, the following possible uses of a profile have
  1827. been identified, but this list is not meant to be exclusive:
  1828.  
  1829.  
  1830.   o Define a set of formats (e.g., media encodings) and a default mapping
  1831.     of those formats to format values.
  1832.  
  1833.   o Define new, application-class-specific options, or specify that an
  1834.     option, such as BOS, should be included in every packet.
  1835.  
  1836.   o Specify the support for and semantics of particular options to be used
  1837.     in Reverse Path messages.
  1838.  
  1839.   o Define new application-class-specific SDES items, or the data format,
  1840.     preferred use, or required use of particular SDES items.
  1841.  
  1842.   o Define when SDES applies to some grouping of channels rather than just
  1843.     a single channel.
  1844.  
  1845.   o Specify that globally synchronized time is required for operation of an
  1846.     application.
  1847.  
  1848.   o Specify  that  a  particular  underlying  network  or  transport  layer
  1849.     protocol will be used to carry RTP packets.
  1850.  
  1851.   o Specify that the RTP header is always to be prefixed by the framing
  1852.     field to allow carrying multiple RTP packets (perhaps for different
  1853.     media) in one lower-layer packet.
  1854.  
  1855. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 34]
  1856. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1857.  
  1858.   o Describe the application of the quality-of-service option.
  1859.  
  1860.  
  1861. It  is  not  expected  that  a  new  profile  will  be  required  for  every
  1862. application.    Within one application class,  it would be better to
  1863. extend an existing profile rather than make a new one.   For example,
  1864. additional options or formats can be defined and registered through IANA for
  1865. publication in the Assigned Numbers RFC as an alternative to publishing a
  1866. new profile specification.
  1867.  
  1868. It is recommended that a profile specify a default port number to be used
  1869. with that profile so that applications that support operation under multiple
  1870. profiles can use the port number to select the profile.
  1871.  
  1872.  
  1873. A Implementation Notes
  1874.  
  1875.  
  1876. We describe aspects of the receiver implementation in this section.  There
  1877. may be other implementation methods that are faster in particular operating
  1878. environments or have other advantages.  These implementation notes are for
  1879. informational purposes only.
  1880.  
  1881. The  following  definitions  are  used  for  all  examples;  the  structure
  1882. definitions are valid for 32-bit big-endian architectures only.  Bit fields
  1883. are assumed to be packed tightly, with no additional padding.
  1884.  
  1885.  
  1886. #include <sys/types.h>
  1887.  
  1888. typedef double CLOCK_t;
  1889.  
  1890. /* the definitions below are valid for 32-bit architectures and will
  1891.    have to be changed for 16- or 64-bit architectures */
  1892. typedef u_long  u_int32;
  1893. typedef u_short u_int16;
  1894.  
  1895. typedef enum {
  1896.   RTP_CSRC   = 0,
  1897.   RTP_SSRC   = 1,
  1898.   RTP_SDST   = 2,
  1899.   RTP_BOS    = 3,
  1900.   RTP_ENC    = 8,
  1901.   RTP_MIC    = 9,
  1902.   RTP_MICA   = 10,
  1903.   RTP_MICK   = 11,
  1904.   RTP_MICS   = 12,
  1905.   RTP_FMT    = 32,
  1906.   RTP_SDES   = 34,
  1907.   RTP_BYE    = 35,
  1908.  
  1909. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 35]
  1910. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1911.  
  1912.   RTP_QOS    = 36,
  1913.   RTP_MINFMT = 96,
  1914.   RTP_MAXFMT = 126,
  1915.   RTP_APP    = 127
  1916. } rtp_option_t;
  1917.  
  1918. typedef struct {
  1919.   unsigned int ver:2;      /* version number */
  1920.   unsigned int channel:6;  /* channel id */
  1921.   unsigned int p:1;        /* option present */
  1922.   unsigned int s:1;        /* sync bit */
  1923.   unsigned int format:6;   /* format of payload */
  1924.   u_int16 seq;             /* sequence number */
  1925.   u_int32 ts;              /* timestamp */
  1926. } rtp_hdr_t;
  1927.  
  1928. typedef union {
  1929.   struct {                 /* generic first 16 bits of options */
  1930.     unsigned int final:1;  /* final option */
  1931.     unsigned int type:7;   /* option type */
  1932.   } generic;
  1933.   struct {
  1934.     unsigned int final:1;  /* final option */
  1935.     unsigned int type:7;   /* option type */
  1936.     u_char length;         /* length, including type/length */
  1937.     u_int16 id[1];         /* content source identifier */
  1938.   } csrc;
  1939.   /* ... */
  1940. } rtp_t;
  1941.  
  1942.  
  1943. A.1 Timestamp Recovery
  1944.  
  1945.  
  1946. For some applications it is useful to have the receiver reconstruct the
  1947. sender's high-order bits of the NTP timestamp from the received 32-bit RTP
  1948. timestamp.  The following code uses double-precision floating point numbers
  1949. for whole numbers with a 48-bit range.  Other type definitions of CLOCK_t
  1950. may be appropriate for different operating environments,  e.g.,  64-bit
  1951. architectures or systems with slow floating point support.   The routine
  1952. applies to any clock frequency, not just the RTP value of 65,536 Hz, and any
  1953. clock starting point.  It will reconstruct the correct high-order bits as
  1954. long as the local clock now is within one half of the wrap-around time of
  1955. the 32-bit timestamp, e.g., approximately 9.1 hours for RTP timestamps.
  1956.  
  1957.  
  1958.  
  1959. #include <math.h>
  1960.  
  1961. #define MOD32bit 4294967296.
  1962. #define MAX31bit 0x7fffffff
  1963.  
  1964. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 36]
  1965. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  1966.  
  1967.  
  1968. CLOCK_t clock_extend(ts, now)
  1969. u_int32 ts;   /* in: timestamp, low-order 32 bits */
  1970. CLOCK_t now;  /* in: current local time */
  1971. {
  1972.   u_int32 high, low;   /* high and low order bits of 48-bit clock */
  1973.  
  1974.   low  = fmod(now, MOD32bit);
  1975.   high = now / MOD32bit;
  1976.  
  1977.   if (low > ts) {
  1978.     if (low - ts > MAX31bit) high++;
  1979.   }
  1980.   else {
  1981.     if (ts - low > MAX31bit) high--;
  1982.   }
  1983.   return high * MOD32bit + ts;
  1984. } /* extend_timestamp */
  1985.  
  1986.  
  1987.  
  1988. Using the full timestamp internally has the advantage that the remainder of
  1989. the receiver code does not have to be concerned with modulo arithmetic.  The
  1990. current local time does not have to be derived directly from the system
  1991. clock for every packet.    For audio samples, for example, it is more
  1992. accurate to maintain the time within a synchronization unit in samples,
  1993. incrementing by the number of samples per packet, and then converting to an
  1994. RTP timestamp.  The following code implements the conversion from a 8 KHz
  1995. sample clock into an RTP timestamp.   This assumes that the sample clock
  1996. is also started at the RTP clock epoch (January 1, 1970).   If not, the
  1997. appropriate offset has to be added.
  1998.  
  1999.  
  2000. CLOCK_t t;       /* 8-kHz sample clock */
  2001. CLOCK_t RTP_ts;  /* RTP timestamp */
  2002.  
  2003. RTP_ts = floor(t * 8.192 + 0.5);
  2004.  
  2005.  
  2006. The whole seconds within NTP timestamps can be obtained by adding 2208988800
  2007. to the value of the standard Unix clock (generated, for example, by the
  2008. gettimeofday system call), which starts from the year 1970.  For the RTP
  2009. timestamp, only the least significant 16 bits of the seconds are used.
  2010.  
  2011.  
  2012. A.2 Detecting the Beginning of a Synchronization Unit
  2013.  
  2014.  
  2015. RTP packets contain a bit flag indicating the end of a synchronization unit.
  2016. The following code fragment determines, based on sequence numbers, if a
  2017.  
  2018. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 37]
  2019. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  2020.  
  2021. packet is the beginning of a synchronization unit.   It assumes that the
  2022. packet header has been converted to host byte order.
  2023.  
  2024.  
  2025. static u_int32 seq_eos;
  2026. rtp_hdr_t *h;
  2027. static int flag;
  2028.  
  2029. if (h->s) {
  2030.   flag    = 1;
  2031.   seq_eos = h->seq;
  2032. }
  2033. /* handle wrap-around of sequence number */
  2034. else if (flag && (h->seq - seq_eos < 32768)) {
  2035.   flag = 0;
  2036.   /* code here to handle beginning of synchronization unit */
  2037. }
  2038.  
  2039.  
  2040. A.3 Demultiplexing and Locating the Synchronization Source
  2041.  
  2042.  
  2043. The combination of destination address, destination port and channel ID
  2044. determines the channel.  For each channel, the receiver maintains a list
  2045. of all sources, content and synchronization sources alike, in a table or
  2046. other suitable data structure.  Synchronization sources are stored with a
  2047. content source identifier of zero.  When an RTP packet arrives, the receiver
  2048. determines its network source address and port (from information returned
  2049. by the operating system), synchronization source identifier (SSRC option)
  2050. and content source identifier(s) (CSRC option).  To locate the table entry
  2051. containing timing information, mapping from content descriptor to actual
  2052. encoding, etc., the receiver sets the content source identifier to zero
  2053. and locates a table entry based on the tuple (transport source address,
  2054. synchronization source identifier, 0).
  2055.  
  2056. The receiver identifies the contributors to the packet (for example, the
  2057. speaker who is heard in the packet) through the list of content source
  2058. identifiers carried in the CSRC option.   To locate the table entry, it
  2059. matches on the triple (network address and port, synchronization source
  2060. identifier, content source identifier).
  2061.  
  2062.  
  2063. A.4 Parsing RTP Options
  2064.  
  2065.  
  2066. The following code segment walks through the RTP options,  preventing
  2067. infinite loops due to zero and invalid length fields.  Structure definitions
  2068. are valid for big-endian architectures only.
  2069.  
  2070.  
  2071.  
  2072.  
  2073. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 38]
  2074. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  2075.  
  2076. u_int32 len;      /* length of RTP packet in bytes */
  2077. u_int32 *pt;      /* pointer */
  2078. rtp_hdr_t *h;     /* fixed header */
  2079. rtp_t *r;         /* options */
  2080.  
  2081. if (h->p) {
  2082.   pt = (u_int32 *)(h+1);
  2083.   do {
  2084.     r = (rtp_t *)pt;
  2085.     pt += r->generic.length;   /* point to end of option */
  2086.  
  2087.     /* invalid length field */
  2088.     if ((char *)pt - (char *)h > len || r->generic.length == 0) return -1;
  2089.  
  2090.     switch(r->generic.type) {
  2091.       case RTP_BYE:
  2092.         /* handle BYE option */
  2093.         break;
  2094.       case RTP_CSRC:
  2095.         /* handle CSRC option */
  2096.         break;
  2097.  
  2098.         /* ... */
  2099.  
  2100.       default:
  2101.                          if   (r->generic.type   >=   RTP_MINFMT   &&   r-
  2102. >generic.type <= RTP_MAXFMT) {
  2103.           /* call option handler particular to this format */
  2104.           (parse_format_options[h->format])(r);
  2105.         }
  2106.         else break;     /* ignore undefined options */
  2107.     }
  2108.   } while (!r->generic.final);
  2109. }
  2110.  
  2111.  
  2112. A.5 Determining the Expected Number of RTP Packets
  2113.  
  2114.  
  2115. The number of packets expected can be computed by the receiver by tracking
  2116. the first sequence number received (seq0),  the last sequence number
  2117. received, seq, and the number of complete sequence number cycles:
  2118.  
  2119.  
  2120. expected = cycles * 65536 + seq - seq0 + 1;
  2121.  
  2122.  
  2123. The cycle count is updated for each packet, where seq_prior is the sequence
  2124. number of the prior packet:
  2125.  
  2126.  
  2127. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 39]
  2128. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  2129.  
  2130. unsigned long seq, seq_prior;
  2131.  
  2132. if (seq - seq_prior > 65536)
  2133.   cycle++;
  2134. else if (seq - seq_prior > 32768)
  2135.   cycle--;
  2136.  
  2137. seq_prior = seq;
  2138.  
  2139.  
  2140. Acknowledgments
  2141.  
  2142.  
  2143. This  memorandum  is  based  on  discussions  within  the  IETF  Audio/Video
  2144. Transport working group chaired by Stephen Casner.  The current protocol has
  2145. its origins in the Network Voice Protocol and the Packet Video Protocol
  2146. (Danny Cohen and Randy Cole) and the protocol implemented by the vat
  2147. application (Van Jacobson and Steve McCanne).   Stuart Stubblebine (ISI)
  2148. helped with the security aspects of RTP. Ron Frederick (Xerox PARC) provided
  2149. extensive editorial assistance.
  2150.  
  2151.  
  2152. B Addresses of Authors
  2153.  
  2154.  
  2155. Stephen Casner
  2156. USC/Information Sciences Institute
  2157. 4676 Admiralty Way
  2158. Marina del Rey, CA 90292-6695
  2159. telephone:  +1 310 822 1511 (extension 153)
  2160. electronic mail:  casner@isi.edu
  2161.  
  2162.  
  2163. Henning Schulzrinne
  2164. AT&T Bell Laboratories
  2165. MH 2A244
  2166. 600 Mountain Avenue
  2167. Murray Hill, NJ 07974-0636
  2168. telephone:  +1 908 582 2262
  2169. facsimile:  +1 908 582 5809
  2170. electronic mail:  hgs@research.att.com
  2171.  
  2172.  
  2173. References
  2174.  
  2175.  
  2176.  [1] D. E. Comer, Internetworking with TCP/IP, vol. 1. Englewood Cliffs,
  2177.      New Jersey:  Prentice Hall, 1991.
  2178.  
  2179.  
  2180. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 40]
  2181. INTERNET-DRAFT           draft-ietf-avt-rtp-04.txt          October 20, 1993
  2182.  
  2183.  [2] J. Postel, "Internet protocol," Network Working Group Request for
  2184.      Comments RFC 791, Information Sciences Institute, Sept. 1981.
  2185.  
  2186.  [3] International  Standards  Organization,  "ISO/IEC  DIS  10646-1:1993
  2187.      information technology -- universal multiple-octet coded character set
  2188.      (UCS) -- part I: Architecture and basic multilingual plane," 1993.
  2189.  
  2190.  [4] The Unicode Consortium, The Unicode Standard. New York, New York:
  2191.      Addison-Wesley, 1991.
  2192.  
  2193.  [5] D. L. Mills, "Network time protocol (version 3) -- specification,
  2194.      implementation  and  analysis,"  Network  Working  Group  Request  for
  2195.      Comments RFC 1305, University of Delaware, Mar. 1992.
  2196.  
  2197.  [6] S.  Kent,  "Understanding  the  Internet  certification  system,"  in
  2198.      Proceedings of the International Networking Conference (INET), (San
  2199.      Francisco, California), pp. BAB--1 -- BAB--10, Internet Society, Aug.
  2200.      1993.
  2201.  
  2202.  [7] D. Balenson, "Privacy enhancement for internet electronic mail:  Part
  2203.      III: Algorithms,  modes,  and identifiers," Network Working Group
  2204.      Request for Comments RFC 1423, IETF, Feb. 1993.
  2205.  
  2206.  [8] V. L. Voydock and S. T. Kent, "Security mechanisms in high-level
  2207.      network protocols," ACM Computing Surveys, vol. 15, pp. 135--171, June
  2208.      1983.
  2209.  
  2210.  [9] J. Kaliski, Burton S., "The MD2 message-digest algorithm," Network
  2211.      Working Group Request for Comments RFC 1319, RSA Laboratories, Apr.
  2212.      1992.
  2213.  
  2214. [10] R. Rivest, "The MD5 message-digest algorithm," Network Working Group
  2215.      Request for Comments RFC 1321, IETF, Apr. 1992.
  2216.  
  2217. [11] S.  Stubblebine,  "Security  services  for  multimedia  conferencing,"
  2218.      in 16th National Computer Security Conference,  (Baltimore,  MD),
  2219.      pp. 391--395, Sept. 1993.
  2220.  
  2221. [12] C. Topolcic, S. Casner, C. Lynn, Jr., P. Park, and K. Schroder,
  2222.      "Experimental internet stream protocol, version 2 (ST-II)," Network
  2223.      Working  Group  Request  for  Comments  RFC  1190,  BBN  Systems  and
  2224.      Technologies, Oct. 1990.
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235. H. Schulzrinne/S. Casner             Expires 12/31/93             [Page 41]
  2236.